]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st/box-layout: Deprecate :pack-start property
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 5 Jan 2022 16:49:46 +0000 (17:49 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 7 Jan 2022 21:47:47 +0000 (21:47 +0000)
A property for reversing the visible order of children is a bit odd.

It has also been unused by actual gnome-shell code since 2010, and the
somewhat related pack_start()/pack_end() API in GtkBox(Layout) is gone
in GTK4.

With that in mind, turn the property into a no-op and deprecate it,
so that it can be dropped next cycle.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2085>

src/st/st-box-layout.c

index 895e688accda82f5fdb9bd4235dd59f5ddda628c..49eaa1948e87351725e57e59d033b39a8b17de9c 100644 (file)
@@ -89,8 +89,7 @@ st_box_layout_get_property (GObject    *object,
       break;
 
     case PROP_PACK_START:
-      layout = clutter_actor_get_layout_manager (CLUTTER_ACTOR (object));
-      g_value_set_boolean (value, clutter_box_layout_get_pack_start (CLUTTER_BOX_LAYOUT (layout)));
+      g_value_set_boolean (value, FALSE);
       break;
 
     default:
@@ -113,7 +112,6 @@ st_box_layout_set_property (GObject      *object,
       break;
 
     case PROP_PACK_START:
-      st_box_layout_set_pack_start (box, g_value_get_boolean (value));
       break;
 
     default:
@@ -202,7 +200,7 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
                                 "Pack Start",
                                 "Whether to pack items at the start of the box",
                                 FALSE,
-                                ST_PARAM_READWRITE);
+                                ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
   g_object_class_install_property (object_class, PROP_PACK_START, pspec);
 }
 
@@ -282,37 +280,23 @@ st_box_layout_get_vertical (StBoxLayout *box)
  * @box: A #StBoxLayout
  * @pack_start: %TRUE if the layout should use pack-start
  *
- * Set the value of the #StBoxLayout:pack-start property.
+ * Deprecated: No longer has any effect
  */
 void
 st_box_layout_set_pack_start (StBoxLayout *box,
                               gboolean     pack_start)
 {
-  ClutterBoxLayout *layout;
-
-  g_return_if_fail (ST_IS_BOX_LAYOUT (box));
-
-  layout = CLUTTER_BOX_LAYOUT (clutter_actor_get_layout_manager (CLUTTER_ACTOR (box)));
-
-  if (clutter_box_layout_get_pack_start (layout) != pack_start)
-    {
-      clutter_box_layout_set_pack_start (layout, pack_start);
-      g_object_notify (G_OBJECT (box), "pack-start");
-    }
 }
 
 /**
  * st_box_layout_get_pack_start:
  * @box: A #StBoxLayout
  *
- * Get the value of the #StBoxLayout:pack-start property.
- *
- * Returns: %TRUE if pack-start is enabled
+ * Returns: the value of the #StBoxLayout:pack-start property,
+ *   always %FALSE
  */
 gboolean
 st_box_layout_get_pack_start (StBoxLayout *box)
 {
-  g_return_val_if_fail (ST_IS_BOX_LAYOUT (box), FALSE);
-
-  return clutter_box_layout_get_pack_start (CLUTTER_BOX_LAYOUT (clutter_actor_get_layout_manager (CLUTTER_ACTOR (box))));
+  return FALSE;
 }